package top.lixunda.ecommerce.server.good.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import top.lixunda.common.keygennerator.BaseKeyGenerator;

import javax.annotation.PostConstruct;

/**
 * @author lixunda
 * @version time:2020/3/20 14:40
 */
@Component
public class KeyGenerator extends BaseKeyGenerator {

    @Value("${xum.generator.worker-id}")
    private long workerId;

    @Value("${xum.generator.data_center_id}")
    private long dataCenterId;

    /**
     * 初始化
     */
    @PostConstruct
    public void initConstruct() {
        init(workerId, dataCenterId);
    }

}
